// pages/index/classDetail/classDetail.js
const util = require("../../../utils/util.js");
Page({

  /**
   * 页面的初始数据
   */
  data: {
    grids: [{
        "info_edit_type": "studmentList",
        "background": "ykt-background1",
        "poorinfo_icon": "icon-banjiguanli",
        "poorinfo_label": "同学名单"
      }, {
        "info_edit_type": "sourceList",
        "background": "ykt-background2",
        "poorinfo_icon": "icon-liebiao",
        "poorinfo_label": "课程列表"
      },
      {
        "info_edit_type": "studmentGrades",
        "background": "ykt-background3",
        "poorinfo_icon": "icon-chengjirending",
        "poorinfo_label": "学生成绩"
      },
      {
        "info_edit_type": "myHomeWork",
        "background": "ykt-background4",
        "poorinfo_icon": "icon-kaoqin",
        "poorinfo_label": "课后作业"
      },
      {
        "info_edit_type": "reding",
        "background": "ykt-background5",
        "poorinfo_icon": "icon-tubiaozhizuomoban-",
        "poorinfo_label": "课后阅读"
      },
      {
        "info_edit_type": "chooseCourse",
        "background": "ykt-background6",
        "poorinfo_icon": "icon-xuanzefenzu",
        "poorinfo_label": "网上选课"
      }      
    ],
    classId:'',
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {
    util.setBarColor()
    this.setData({
      classId:options.classId,
      className:options.className
    })
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {

  },
  studmentList: function () {
    wx.navigateTo({
      url: '/pages/index/class/studmentList/studmentList?classId=' + this.data.classId,
    })
  },
  sourceList: function () {
    wx.navigateTo({
      url: '/pages/index/class/sourceList/sourceList?classId=' + this.data.classId,
    })
  },
  studmentGrades: function () {
    wx.navigateTo({
      url: '/pages/index/class/studmentGrades/studmentGrades?classId=' + this.data.classId,
    })
  },
  myHomeWork: function () {
    wx.navigateTo({
      url: '/pages/index/class/myHomeWork/myHomeWork?classId=' + this.data.classId,
    })
  },
  reding: function () {
    wx.navigateTo({
      url: '/pages/index/class/reding/reding?classId=' + this.data.classId,
    })
  },
  chooseCourse: function () {
    wx.navigateTo({
      url: '/pages/index/class/chooseCourse/chooseCourse?classId=' + this.data.classId,
    })
  },
  //修改班级信息
  updateClassMessage:function(){
    wx.navigateTo({
      url: '/pages/index/classDetail/updateClass/updateClass?id='+this.data.classId,
    })
  }
})